﻿@using MvcApplication1.Controllers

@functions {private string GetClientIp()
            {
                string ip = Request.ServerVariables.Get("Remote_Addr").ToString(); ;
                return ip;
            }

}
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
    
    <!--通用css-->
    <link rel="stylesheet" type="text/css" href="~/Content/Site.css">
    <!--960css框架-->
    <link rel="stylesheet" type="text/css" href="~/Content/960/fluid/reset.css">
    <link rel="stylesheet" type="text/css" href="~/Content/960/fluid/text.css">
    <link rel="stylesheet" type="text/css" href="~/Content/960/fluid/grid.css">

    <!--easyuid主题-->
    <link rel="stylesheet" type="text/css" href="~/Content/easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="~/Content/easyui/themes/icon.css">
    <!--加载样式修正CSS-->
    <link rel="stylesheet" type="text/css" href="~/Content/fix.css">
    
    <!--js-->
    <script type="text/javascript" src="~/Scripts/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="~/Scripts/easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="~/Scripts/easyui/locale/easyui-lang-zh_CN.js"></script>
    <script>
        $(function () {

            //绑定菜单单击事件
            BindMenuClick();

            showMsg();

        });

        function showMsg() {
            var dt = new Date();
            var y = dt.getFullYear();
            var m = dt.getMonth() + 1;
            var d = dt.getDate();
            var ip = "@GetClientIp()";
            var t = "系统提示";
            var msg = "欢迎登陆系统</br> " + y + "-" + m + "-" + d + "</br>" + ip;

            $.messager.show({
                title: t,
                msg: msg,
                showType: 'show'
            });
        }

        //实现用户单击菜单跳转页面的方法
        function BindMenuClick() {
            $('#menuTree').tree({
                onClick: function (node) {

                    if (node) {
                        if (node.attributes) {

                            addTab(node.text, node.attributes.u);
                            //alert(node.attributes.u);
                        }
                    }
                }
            });
        }

        function addTab(title, url) {
            if ($('#tt').tabs('exists', title)) {
                $('#tt').tabs('select', title);
            } else {
                var content = '<iframe scrolling="auto" frameborder="0"  src="' + url + '" style="width:100%;height:98%;"></iframe>';
                $('#tt').tabs('add', {
                    title: title,
                    content: content,
                    closable: true
                });
            }
        }
</script>
</head>
<body class="easyui-layout">
    
        @*页面顶部*@
        <div data-options="region:'north'" style="height:80px">
            <h2>Head</h2>
        </div>
        

        @*左部导航菜单*@
        <div data-options="region:'west',split:true" title="West" style="width:150px;">
            @*动态读取菜单树*@
            <div style="margin:10px">
                <ul id="menuTree" class="easyui-tree" data-options="url:'/Home/LoadMenuData',lines:true,animate:true"></ul>
            </div>
        </div>
    
        @*页面内容*@
        <div data-options="region:'center'">
        
            @*标签组*@
            <div class="easyui-tabs" id="tt" data-options="fit:true,border:false" >
                <div id="tab1" title="待处理任务">
                    待处理任务
                </div>
            </div>

        </div>
        
        @*页面底部*@
        <div data-options="region:'south',split:true" style="height:50px;padding-top:10px;text-align:center">
            版权所有 CopyRight ? @System.DateTime.Today.Year DL
        </div>
    
</body>
</html>
